home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 2 / Amiga Tools 2.iso / tex / macros / contrib / float.sty < prev    next >
Encoding:
Text File  |  1995-03-15  |  5.7 KB  |  140 lines

  1. %% 
  2. %% This is file `float.sty', generated 
  3. %% on <1995/3/4> with the docstrip utility (2.2i).
  4. %% 
  5. %% The original source files were:
  6. %% 
  7. %% float.dtx  (with options: `package')
  8. %% 
  9. %% IMPORTANT NOTICE: 
  10. %% This file is a stripped version of `float.dtx', 
  11. %% copyright (c) 1991-4 by Anselm Lingnau (lingnau@math.uni-frankfurt.de). 
  12. %% 
  13. %% You are not allowed to distribute this file. 
  14. %% For distribution of the original source see 
  15. %% the copyright notice in the source file. 
  16. %% 
  17. %% Package `float' to use with LaTeX 2e
  18. %% Copyright (C) 1991-1994 Anselm Lingnau, all rights reserved
  19. %%
  20. %% You may use and distribute this file freely, provided that
  21. %% you don't make any money off it or pretend that you wrote it.
  22. \NeedsTeXFormat{LaTeX2e}[1994/06/01]
  23. \ProvidesPackage{float}
  24.          [1994/06/20 v1.2 Float enhancements (AL)]
  25. \newcounter{float@type}
  26. \@ifundefined{c@figure}%
  27.   {\setcounter{float@type}{1}}%
  28.   {\setcounter{float@type}{4}}
  29. \newcommand\floatstyle[1]{\@ifundefined{fs@#1}%
  30.   {\float@error{#1}}%
  31.   {\def\float@style{#1}}}
  32. \newcommand\float@error[1]{\PackageError{float}{%
  33.   Unknown float style `#1'
  34. }{\@eha}}
  35. \newcommand\floatname[2]{\@namedef{fname@#1}{#2}}
  36. \newcommand\floatplacement[2]{\@namedef{fps@#1}{#2}}
  37. \newcommand\restylefloat[1]{\expandafter\edef\csname
  38.   fst@#1\endcsname{\expandafter\noexpand\csname
  39.     fs@\float@style\endcsname}%
  40.    \@namedef{#1}{\bgroup\@nameuse{fst@#1}\@float{#1}}%
  41.    \@namedef{#1*}{\bgroup\@nameuse{fst@#1}\@dblfloat{#1}}%
  42.    \expandafter\let\csname end#1\endcsname\float@end
  43.    \expandafter\let\csname end#1*\endcsname\float@dblend}
  44. \newcommand\newfloat[3]{\@namedef{ext@#1}{#3}
  45.   \floatplacement{#1}{#2}%
  46.   \@ifundefined{fname@#1}{\floatname{#1}{#1}}{}
  47.   \expandafter\edef\csname ftype@#1\endcsname{\value{float@type}}%
  48.   \addtocounter{float@type}{\value{float@type}}
  49.   \restylefloat{#1}%
  50.   \expandafter\edef\csname fnum@#1\endcsname%
  51.     {\expandafter\noexpand\csname fname@#1\endcsname{}
  52.        \expandafter\noexpand\csname the#1\endcsname}
  53.   \@ifnextchar[{\@xnewfloat{#1}}%
  54.     {\@ifundefined{c@#1}{\newcounter{#1}\@namedef{the#1}{\arabic{#1}}}%
  55.       {}}}
  56. \def\@xnewfloat#1[#2]{\@ifundefined{c@#1}{\newcounter{#1}[#2]%
  57.     \expandafter\edef\csname the#1\endcsname{%
  58.       \expandafter\noexpand\csname
  59.         the#2\endcsname.\noexpand\arabic{#1}}}%
  60.     {\PackageWarning{float}{Can't redefine counter variable for #1.}}}
  61. \let\@Hxfloat\@xfloat
  62. \def\@xfloat#1[{\@ifnextchar{H}{\@HHfloat{#1}[}{\@Hxfloat{#1}[}}
  63. \newsavebox\float@box
  64. \newif\if@flstyle
  65. \def\@HHfloat#1[H]{%
  66.   \expandafter\let\csname end#1\endcsname\float@endH
  67.   \let\@currbox\float@box
  68.   \def\@captype{#1}\setbox\@floatcapt=\vbox{}%
  69.   \expandafter\ifx\csname fst@#1\endcsname\relax
  70.     \@flstylefalse\else\@flstyletrue\fi
  71.   \setbox\@currbox=\vbox\bgroup\parindent\z@
  72.   \ignorespaces}
  73. \newcommand\float@makebox{%
  74.   \vbox{\hsize\columnwidth \@parboxrestore
  75.     \@fs@pre\@fs@iftopcapt
  76.       \ifvbox\@floatcapt\unvbox\@floatcapt\par\@fs@mid\fi
  77.       \unvbox\@currbox
  78.     \else\unvbox\@currbox
  79.       \ifvbox\@floatcapt\par\@fs@mid\unvbox\@floatcapt\fi
  80.     \fi\par\@fs@post\vskip\z@}}
  81. \newcommand\float@end{\egroup
  82.   \global\setbox\@currbox\float@makebox
  83.    \ifnum\@floatpenalty <\z@ \@cons\@currlist\@currbox
  84.      \ifdim \ht\@currbox >\textheight
  85.         \ht\@currbox\textheight \fi
  86.      \ifnum\@floatpenalty < -\@Mii
  87.         \penalty -\@Miv \@tempdima\prevdepth
  88.         \vbox{}\prevdepth \@tempdima \penalty\@floatpenalty
  89.       \else \vadjust{\penalty -\@Miv
  90.         \vbox{}\penalty\@floatpenalty}\@Esphack
  91.      \fi\fi\egroup}
  92. \newcommand\float@endH{\egroup \vskip\intextsep
  93.   \if@flstyle\float@makebox\egroup\else\box\@currbox\fi
  94.   \vskip\intextsep\relax}
  95. \newcommand\float@dblend{\if@twocolumn
  96.   \par\vskip\z@\egroup
  97.   \ifnum\@floatpenalty <\z@ \@cons\@dbldeferlist\@currbox\fi
  98.     \ifnum \@floatpenalty =-\@Mii \@Esphack\fi\egroup\else\float@end\fi}
  99. \newsavebox\@floatcapt
  100. \renewcommand\caption{\refstepcounter\@captype
  101.   \expandafter\ifx\csname fst@\@captype\endcsname\relax
  102.       \let\@tempf\@caption
  103.     \else\let\@tempf\float@caption\fi \@dblarg{\@tempf\@captype}}
  104. \long\def\float@caption#1[#2]#3{\addcontentsline{\@nameuse{ext@#1}}{#1}%
  105.    {\protect\numberline{\@nameuse{the#1}}{\ignorespaces #2}}
  106.   \global\setbox\@floatcapt\vbox\bgroup\@parboxrestore
  107.     \normalsize\@fs@capt{\@nameuse{fnum@#1}}{\ignorespaces #3}%
  108.     \@ifnextchar[{\float@ccon}{\egroup}}
  109. \long\def\float@ccon[#1]{#1\par\egroup}
  110. \newcommand\listof[2]{%
  111.   \@ifundefined{ext@#1}{\float@error{#1}}{%
  112.     \@ifundefined{chapter}{\def\@tempa{\section*}}%
  113.       {\def\@tempa{\chapter*}}%
  114.     \@tempa{#2\@mkboth{\uppercase{#2}}{\uppercase{#2}}}%
  115.     \@namedef{l@#1}{\@dottedtocline{1}{1.5em}{2.3em}}%
  116.     \@starttoc{\@nameuse{ext@#1}}}}
  117. \newcommand\floatc@plain[2]{\setbox\@tempboxa\hbox{{\@fs@cfont #1:} #2}%
  118.   \ifdim\wd\@tempboxa>\hsize {\@fs@cfont #1:} #2\par
  119.     \else\hbox to\hsize{\hfil\box\@tempboxa\hfil}\fi}
  120. \newcommand\fs@plain{\def\@fs@cfont{\rmfamily}\let\@fs@capt\floatc@plain
  121.   \def\@fs@pre{}\def\@fs@post{}\def\@fs@mid{\vspace{10pt}\relax}%
  122.   \let\@fs@iftopcapt\iffalse}
  123. \newcommand\floatc@ruled[2]{{\@fs@cfont #1} #2\par}
  124. \newcommand\fs@ruled{\def\@fs@cfont{\bfseries}\let\@fs@capt\floatc@ruled
  125.   \def\@fs@pre{\hrule height.8pt depth0pt \kern2pt}%
  126.   \def\@fs@post{\kern2pt\hrule\relax}%
  127.   \def\@fs@mid{\kern2pt\hrule\kern2pt}%
  128.   \let\@fs@iftopcapt\iftrue}
  129. \newcommand\fs@boxed{\def\@fs@cfont{\bfseries}\let\@fs@capt\floatc@plain
  130.   \def\@fs@pre{\dimen0=\hsize \advance\dimen0 by6.8pt \hbadness10000
  131.     \moveleft3.4pt\vbox\bgroup\hsize=\dimen0\hrule
  132.       \hbox to\dimen0\bgroup\vrule\kern3pt\vbox\bgroup\kern3pt}%
  133.   \def\@fs@mid{\kern3pt\egroup\kern3pt\vrule\egroup
  134.     \hrule\egroup\kern2pt}%
  135.   \def\@fs@post{}\let\@fs@iftopcapt\iffalse}
  136. \floatstyle{plain}
  137. \endinput
  138. %% 
  139. %% End of file `float.sty'.
  140.